namespace StudentVideo.Shared.Models;

/// <summary>
/// 统一返回类型
/// </summary>
/// <typeparam name="T">返回数据的类型</typeparam>
public class HttpResult<T> {
   /// <summary>
   /// 状态码
   /// </summary>
   /// <example>200</example>
   public int StatusCode { get; set; } = 200;

   /// <summary>
   /// 附带信息
   /// </summary>
   /// <example>Ok</example>
   public string Message { get; set; } = string.Empty;

   /// <summary>
   /// 时间戳
   /// </summary>
   /// <example>2023-10-01T12:34:56Z</example>
   public string Timestamp { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");

   /// <summary>
   /// 返回数据
   /// </summary>
   /// <example>null</example>
   public T? Data { get; set; }
}

/// <summary>
/// 非泛型返回类型（默认使用object）
/// </summary>
public class HttpResult : HttpResult<object> { }
